package com.xn.monitor.web.notify;

import com.xn.monitor.entity.ServerEventInfo;

import java.util.Observable;
import java.util.Observer;

/**
 * 通知服务抽象接口
 *
 * Created by yangshoujun on 2017/7/29 下午1:12.
 */
public interface NotifyService extends Observer {

    public void notify(ServerEventInfo eventObject);

    default void update(Observable o, Object eventObject) {
        if(!(eventObject instanceof ServerEventInfo)) {
            return;
        }

        notify((ServerEventInfo) eventObject);
    }
}
